import { redirect } from "next/navigation"
import getViewer from "./getViewer"


const getClientViewer = async () => {
  const viewer = await getViewer()
  if (!viewer || (viewer.role !== 0)) {
    redirect("/")
  }
  return viewer
}
export default getClientViewer